<?php
include_once '../../Model/M_Rubro.php';

$rubro = new M_Rubro();
$rubro->setIdRubro($_REQUEST['idRubro']);
$lista = $rubro->searchRubro();
?>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>EDITAR RUBRO</title>
        <style type="text/css">
            @import "../css/mantenedores.css";
            @import "../css/principal.css";
        </style>
        <script>
            function check()
            {
                if (document.formulario.nom.value == '')
                {
                    alert("Debe ingresar un nombre. Gracias");
                    document.forms[0].nom.focus();
                    return false;                  
                }
            }
        </script>
    </head>
    <body>
        <div id="controles">
            <img SRC="../images/roles.png" width="55px" height="55px"></img> EDITAR RUBRO
        </div>
        <br/>   <br/> <br/> <br/> 
        <form name="formulario"  method="post" action="../../Controller/C_Rubro_U.php" onsubmit="return check();" enctype="multipart/form-data">
            <input type="hidden" name="idPag" value="<? echo($_REQUEST['idPag']);?>">
            <div id="formularios">
                
                <table border="0" align="center">
                        <tr>
                            <td>Nombre: <font color="#FF0000">(*)</font></td>                            
                            <td><input type="text" style="width: 300px;" name="nom" value="<?php echo($lista[0]['nombre']);?>" /></td>
                        </tr>
                        <tr>
                            <td>Imagen: <font color="#FF0000">(*)</font></td>                            
                            <td><input type="file" name="rutaImagen"></td>
                        </tr>
                        <tr>                          
                            <td>
                                <input class="button_rojo" onclick="javascript:history.go(-1)" height='30px' type="button" value="Cancelar"/>                                
                                <input class="botones" type="submit" value="Guardar Cambios" />
                                <input type="text" name="idRubro" value="<?php echo($lista[0]['id_rubro']);?>" hidden />
                            </td>          
                        </tr>                        
                </table>
            </div>
        </form>

    </body>
</html>
<?php

?>